import request from '@/config/axios'

export interface ClassifyItem {
  id: number
  name: string
  parentId?: number | null
}

export const ClassifyApi = {
  // 获取分类列表
  getClassifyList: async (params: any) => {
    return await request.get({ url: '/lession/classify/list', params })
  },

  // 新增分类
  createClassify: async (data: any) => {
    return await request.post({ url: '/lession/classify/create', data })
  },

  // 修改分类
  updateClassify: async (data: any) => {
    return await request.put({ url: '/lession/classify/update', data })
  },

  // 删除分类
  deleteClassify: async (id: number) => {
    return await request.delete({ url: '/lession/classify/delete?id=' + id })
  }
}
